home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_PICT / Source / CommentedPSCode / Comments < prev    next >
Text File  |  1995-06-12  |  4KB  |  160 lines

  1. %BEGIN Comments
  2.  
  3. % Copyright (C) 1993 David John Burrowes
  4. % Distributed under terms of GNU General Public License.
  5. % See COPYING.text in Convert PICT's CommentedPSCode for a copy
  6.  
  7. /rotateX    0     def
  8. /rotateY    0    def
  9. /DoingRotate    false    def
  10.  
  11. %%%%%%%%%%%%%
  12. %    Name:    shortComment    [00A0]
  13. %    Syntax:    num shortComment -
  14. %            /name shortComment -
  15. %    About:    This processes a PICT short comment
  16. %    Note:    This ignores unknown comments.
  17. %%%%%%%%%%%%%
  18. /shortComment
  19. {
  20.     /commentKind exch def
  21.     
  22.     commentKind  /RotateEnd eq
  23.     {
  24.         DoingRotate true eq
  25.         {
  26.             restore 
  27.             /DoingRotate false def
  28.         }
  29.         if
  30.     }
  31.     {
  32.         commentKind  /DashedStop eq
  33.         { [ ] 0 setdash }
  34.         {
  35.             commentKind  /TextIsPostScript eq
  36.             { /suppressText true def }
  37.             {
  38.                 commentKind  /TextEnd  eq
  39.                     { /rotateText false def }
  40.                 if
  41.             }
  42.             ifelse
  43.         }
  44.         ifelse
  45.     }
  46.     ifelse
  47. }
  48. def
  49.  
  50. %%%%%%%%%%%%%
  51. %    Name:    longComment        [00A1]
  52. %    Syntax:    <string> num longComment -
  53. %            args /name longComment
  54. %    About:    This processes a PICT long comment (a number indicating the
  55. %            kind of comment, and a hex string of related data
  56. %    Note:    This ignores unknown comments.
  57. %            See the end of the file for details about arguments.
  58. %%%%%%%%%%%%%
  59. /longComment
  60. {
  61.     /commentKind exch def
  62.  
  63.     commentKind  /RotateCenter eq
  64.     {
  65.         /thePoint exch def
  66.         /rotateX thePoint 1 get def
  67.         /rotateY thePoint 0 get def
  68.     }
  69.     {
  70.         commentKind  /RotateBegin eq
  71.         {
  72.             /rotateInfo exch def
  73.             save
  74.             /DoingRotate true def
  75.             rotateInfo 2 get rotate
  76.         }
  77.         {
  78.             commentKind  /SetLineWidth eq
  79.             {
  80.                 /lineWidth exch def
  81.                 /penWidth lineWidth def
  82.                 /penHeight lineWidth def
  83.             }
  84.             {
  85.                 commentKind  /SetGrayLevel eq
  86.                 {
  87.                     %
  88.                     %    Set the current foreground color to the shade of grey specified.
  89.                     %
  90.                     /greyvalue exch def
  91.                     /foregroundColor [ greyvalue greyvalue greyvalue ] def
  92.                 }
  93.                 {
  94.                     commentKind  /DashedLine eq
  95.                     {
  96.                         /dashInfo exch def
  97.                         dashInfo 1 get dashInfo 0 get setdash
  98.                     }
  99.                     {
  100.                         commentKind  /TextCenter eq
  101.                         {
  102.                             /rotateInfo exch def
  103.                             /textCenterX rotateInfo 1 get def
  104.                             /textCenterY rotateInfo 0 get def
  105.                         }
  106.                         {
  107.                             commentKind  /TextBegin eq
  108.                             {
  109.                                 /rotateText true def
  110.                                 /rotateInfo exch def
  111.                                 /textAngle rotateInfo 3 get def
  112.                             }
  113.                             {pop}
  114.                             ifelse
  115.                         }
  116.                         ifelse
  117.                     }
  118.                     ifelse
  119.                 }
  120.                 ifelse
  121.             }
  122.             ifelse
  123.         }
  124.         ifelse
  125.     }
  126.     ifelse
  127. }
  128. def
  129.  
  130. %
  131. %    Details about arguments to the various piccomments (passed to longcomment)  (note,
  132. %    parameters always bundled so there is just one argument.
  133. %    If TextBegin or RotateBegin gets confused will write out as generic.
  134. %    DashedLine an produced a mangled argument like [# # <ABCDEF>] # if it gets confused
  135. %
  136. %    | means OR  # means a number argument, #f means a float argument ? optional
  137. %    ... means repeat last item some number of times
  138. %
  139. %    Generally one will probably see generic arguments:
  140. %        <ABCDEF12345> 143
  141. %    But, the special ones are:
  142. %        <ABCDEF41424344> /AppComment
  143. %        [/tJustNone|/tJusLeft|/tJusCenter|/tJusRight|/tJusFull
  144. %            /tFlipNone|/tFlipHorozontal|/tFlipVertical #degrees #fdegrees] /TextBegin
  145. %        [#fy #fx] /TextCenter
  146. %        [ #numchars #f%major-err-to-spaces #space-char
  147. %            #f%interchar  %funderline-width] /ClintLineLayout
  148. %        [ ?/Close ?/Full ?/Frame] /PolySmooth
  149. %        [ #offet [ #interval...] ] /DashedLine     (see the PS manual about dashed lines)
  150. %        # # div  /SetLineWidth
  151. %        (balanced-ps-info-would-go-here) /PostScriptHandle
  152. %        (filename-would-go-here) /PostScriptFile
  153. %        [ ABCD #id #index ] /ResourcePS    (ABCD is some mac resource type)
  154. %        #f /SetGrayLevel
  155. %        [ #flip #angle #fangle ] /RotateBegin
  156. %        [ #fy #fx ] /RotateCenter
  157. %
  158.  
  159. %END Comments
  160.